/*
 * @Author: HeAo
 * @Date: 2021-09-29 15:52:44
 * @LastEditTime: 2021-09-29 16:00:19
 * @LastEditors: HeAo
 * @Description:
 * @FilePath: \web2103-2105\web2105\3-1-ES6\day05\4-generator.js
 * 别乱动！
 */
function* myGunFun () {
  console.log('状态一');
  let result = yield 'one'

  console.log('状态二');
  console.log(result);
  yield 'two'

  console.log('状态三');
  return 'end'
}

let iteartor = myGunFun()
console.log(iteartor);
console.log(iteartor.next());
console.log(iteartor.next('你好'));
console.log(iteartor.next());

